<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
  </head>
  
  <body>
    <%
	    Runtime rt = Runtime.getRuntime();
		String backPath = request.getRealPath("/")
				+ "back/"
				+ System.currentTimeMillis() + ".sql";
		String mysql = "mysqldump -uroot -p123qweasd  --default-character-set=utf8 aycshop >"
				+ "\"" + backPath + "\"";
		Process proc = rt.exec(new String[] { " "+mysql });// 设置导出编码为utf8。这里必须是utf8
		int tag = proc.waitFor();// 等待进程终止
		out.println(tag);
    %>
  </body>
</html>
